package com.rui.principles.demo03.before;
/**
 * @className    : ComputerDemo
 * @author       : [锐神NO.3]
 * @version      : [v1.0]
 * @createTime   : [2022/2/9 9:35]
 * @description  : [描述该类的功能]
 */
 
public class ComputerDemo {
    public static void main(String[] args) {
        //创建组件对象
        XiJieHardDisk hardDisk = new XiJieHardDisk();
        IntelCpu cpu = new IntelCpu();
        KingstonMemory memory = new KingstonMemory();

        //创建计算机对象
        Computer c = new Computer();

        //组装计算机
        c.setCpu(cpu);
        c.setHardDisk(hardDisk);
        c.setMemory(memory);

        //运行计算机
        c.run();
    }
}
